﻿using System;
using System.Diagnostics.Contracts;

namespace Cloak.Mvvm.Navigation
{
	/// <summary>
	/// A parameter available when resolving a view model
	/// </summary>
	public sealed class PageModelParameter
	{
		/// <summary>
		/// Initializes an instance of <see cref="PageModelParameter"/>
		/// </summary>
		/// <param name="name">The name of the parameter specified during resolution of the view model</param>
		/// <param name="type">The type of the parameter</param>
		/// <param name="queryStringKey">The querystring key which provides the parameter value</param>
		public PageModelParameter(string name, Type type, string queryStringKey)
		{
			Contract.Requires(name != null);
			Contract.Requires(type != null);
			Contract.Requires(queryStringKey != null);

			Name = name;
			Type = type;
			QueryStringKey = queryStringKey;
		}

		/// <summary>
		/// Gets the name of the parameter specified during resolution of the view model
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// Gets the type of the parameter
		/// </summary>
		public Type Type { get; private set; }

		/// <summary>
		/// Get the querystring key which provides the parameter value
		/// </summary>
		public string QueryStringKey { get; private set; }
	}
}